<template>
  <div
    id="app"
    :locale="elementLocale"
  >
    <router-view />
  </div>
</template>

<script setup lang="ts">
  import en from 'element-plus/es/locale/lang/en';
  import zhCn from 'element-plus/es/locale/lang/zh-cn';
  import { computed } from 'vue';
  import { useI18n } from 'vue-i18n';

  const { locale } = useI18n();

  // Element Plus 语言配置
  const elementLocale = computed(() => {
    switch (locale.value) {
      case 'en-US':
        return en;
      case 'zh-CN':
      default:
        return zhCn;
    }
  });
</script>

<style>
  #app {
    width: 100%;
    height: 100%;
  }
</style>
